package fr.iut2.tc4.gestionabsencesnotes.modelebean;

import org.apache.torque.TorqueException;

import fr.iut2.tc4.gestionabsencesnotes.torque.generated.BaseEtudiant;
import fr.iut2.tc4.gestionabsencesnotes.torque.generated.Etudiant;

public class TestAbsences {

	/**
	 * @param args
	 * @throws Exception 
	 * @throws TorqueException 
	 */
	public static void main(String[] args) throws TorqueException, Exception {
		
		System.out.println("Liste des BaseEtudiants :");
		for (Etudiant etu : GestionFactory.getEtudiants()) {
			System.out.println(etu.getPrenomEtudiant() + " " + etu.getNomEtudiant() + " " + etu.getGroupe() + " " + etu.getAbsences().size());
		}
		
		System.out.println("\nListe des BaseEtudiants MIAM:");
		for (BaseEtudiant etu : GestionFactory.getEtudiantsParGroupe("MIAM")) {
			System.out.println(etu.getPrenomEtudiant() + " " + etu.getNomEtudiant() + " " + etu.getGroupe() + " " + etu.getAbsences().size());
		}
		
		System.out.println("\nListe des BaseEtudiants 3IS:");
		for (BaseEtudiant etu : GestionFactory.getEtudiantsParGroupe("3IS")) {
			System.out.println(etu.getPrenomEtudiant() + " " + etu.getNomEtudiant() + " " + etu.getGroupe() + " " + etu.getAbsences().size());
		}
		
		System.out.println("\nListe des BaseEtudiants MESSI:");
		for (BaseEtudiant etu : GestionFactory.getEtudiantsParGroupe("MESSI")) {
			System.out.println(etu.getPrenomEtudiant() + " " + etu.getNomEtudiant() + " " + etu.getGroupe() + " " + etu.getAbsences().size());
		}
	}

}
